{extend name="common/layout" /}
{block name="main"}
<div class="container content-wrap" >
    <div class="row" >
        <main class="col-md-8 main-content">
            <ol class="breadcrumb crumb">
                <li><a href="/">首页</a></li>
                <li><a href="#">文章</a></li>
                <li class="active">{$title}</li>
            </ol>

            <article id="{$article.id}" class="post">
                <div class="post-head">
                    <h3 class="post-title">{$article.subject}</h3>
                    <div class="post-meta">
                        <span class="author">作者：<a href="/">小森同学</a></span> •
                        <time class="post-date" datetime="{$article.created_time}" title="{$article.created_time}">{$article.created_time}</time> •
                        点击量 <span class="viewed" data-url="{:url('item/getVisit', 'id='.$article.id)}"></span>
                    </div>
                </div>

                <div class="col-xs-12 col-md-12 post-content">
                    {$article.content}
                    {if $next || $prev}
                    <div class="row">
                        {if $prev}
                        <div class="col-xs-12 col-md-12">
                            上一篇: <a href="{:url('@index/item/index', 'id='.$prev.id)}">{$prev.subject}</a>
                        </div>
                        {/if}
                        {if $next}
                        <div class="col-xs-12 col-md-12">
                            下一篇: <a href="{:url('@index/item/index', 'id='.$next.id)}">{$next.subject}</a>
                        </div>
                        {/if}
                    </div>
                    {/if}
                </div>
            </article>

        </main>
        <sidebar class="col-md-4 sidebar">

            {include file="common/rightRecommendGoodsList" /}

            <div class="widget">
                <h4 class="title">关于我</h4>
                <div class="content community">
                    <ul class="video">
                        {volist name="videoList" id="val"}
                        <li  data-video="{$val['video']}">{$val['name']}</li>
                        {/volist}
                    </ul>
                </div>
            </div>
        </sidebar>
    </div>

</div>
{/block}
{block name="js"}
<script>
    $(document).ready(function () {
        //获取点击量
        var url = $('.viewed').data('url');
        $.get(url,function (data) {
            $('.viewed').html(data);
        });
    })
</script>
{/block}